<template>
<div class="help_bg">
<!--  轮播图盒子-->
  <div style="
  background-image: url(https://pic32.photophoto.cn/20140714/0008021029087645_b.jpg);
">
  <div class="imgs">
    <el-carousel :interval="4000" type="card" height="300px" autoplay>
      <el-carousel-item v-for="item in imgArray" :key="item.id">
        <el-image
            style="width: 100%; height: 100%"
            :src="item.imag"
            @click="$router.push('/mother/articleDetail?id='+item.aid)"
            ></el-image>
      </el-carousel-item>
    </el-carousel>
  </div>
  </div>
<!--  主体内容设置-->
  <div class="conter">
    <div style="background-color: #e9eaec;width: 850px;height: 100%;float: left">
<!--      导航标签-->
      <div style="width: 850px;height: 60px;">
        <el-menu
            :default-active="'/mother/mainpage/announcementArticleOfHomeView'"
            class="el-menu-demo"
            mode="horizontal"
            router
            @select="handleSelect"
        >
          <el-menu-item index="/mother/mainpage/"><img src="../../assets/recomand.png"></el-menu-item>
          <el-menu-item index="/mother/mainpage/announcementArticleOfHomeView">公告</el-menu-item>
          <el-menu-item index="/mother/mainpage/recomandArticleOfHomeView">推荐菜谱</el-menu-item>
        </el-menu>
      </div>
      <div style="background-color: #1e9fff;width: 100%;height: 473px">
        <router-view></router-view>
      </div>
    </div>
    <div style="width: 600px;height: 650px;margin-left: 800px;">
      <div style="width: 85%;height: 90%;float:left;margin-left: 10px; background-color: #FAFAFA;margin-bottom: 10px">

        <div class="rili" style="background-color: #00a4ff">
          <el-calendar v-model="value" style="background-color: #FBFBFB">
            <template slot="dateCell " slot-scope="{ date, data }">
              <div :class="data.isSelected ? 'is-selected' : ''">
                {{ data.day.split("-")[2] }}
              </div>
            </template>
          </el-calendar>
        </div>
        <a  class="guanggao" href="https://bbs.csdn.net/topics/603764095?utm_medium=ad.590" target="_blank">

        </a>
      </div>
    </div>
  </div>
</div>
</template>

<script>

import request from "@/router/request";

export default {
  name: "Mainpage",
  data (){
    return{
      value: new Date(),
      imgArray: []
    }
  },
  created(){
    this.getAll()
  },

  methods: {

    getAll(){
      request.get("/announcement").then(res=>{
        if (res.state=='0'){
          console.log("asdasdasdasdasdasdsad:"+res)
          this.imgArray=res.data
        }else
        {
          console.log(this.$message.error("查询图片时出现问题"))
        }
      })
    },


  }
}
</script>

<style scoped>

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}

.rili{
  margin-top: 10px;
  width: 100%;
  height: 400px;
}
.help_bg{
  position: absolute;
  height: 100%;
  width: 100%;
  top:0;
  left: 0;
  overflow-y: auto;
}
.imgs{
  height: 55%;
  width: 80%;
  margin-left: 10%;
  margin-top: 80px;
}
.conter{
  height: 100%;
  width: 100%;
  float: left;
}

</style>
